<template>
  <div>
      <van-index-anchor :index="index"/>
      <van-cell :title="item.label?item.label:item" v-for="(item) in val" :key="item.value" @click="selCityFn(item)"/>
  </div>
</template>

<script>
export default {
  data () {
    return {
      selCity: '北京'
    }
  },
  props: ['val', 'index'],
  created () {
  },
  methods: {
    selCityFn (city) {
      if (city.label) {
        this.selCity = city.label
        localStorage.setItem('sel_city', JSON.stringify(city))
        this.$router.push({
          path: '/home'
        })
      }
    }
  }
}
</script>

<style lang="less" scoped>
</style>
